package com.collection.vectors;

import java.util.Vector;

public class GetSizeOfVectorExample {
	 public static void main(String[] args) {
		    //create a Vector object
		    Vector v = new Vector();
		   
		    //Add elements to Vector using
		    v.add("1");
		    v.add("2");
		    v.add("3");
		 
		    //To get size of Java Vector use int size() method
		    int totalElements = v.size();
		   
		    System.out.println("Vector contains...");
		    //loop through it
		    for(int index=0; index < totalElements; index++)
		      System.out.println(v.get(index));
		   
		  }
}
